package com.example.guideme;

import com.example.guideme.R.drawable;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;

public class MainActivity extends Activity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.activity_main, menu);
		return true;
	}

	public void FindLocation(View view) {
		// Location button
		Intent intent = new Intent(this, LocationActivity.class);
		startActivity(intent);
	}

	public void ReportBugs(View view) {
		String[] shareEmail = new String[] {"guideme.app@gmail.com"};
		String shareSubject = "Found a bug - GuideMe!";
		String shareBody = "Please mention how and where you found the bug!\n\n";

		Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
		sharingIntent.setType("message/rfc822");
		sharingIntent.putExtra(android.content.Intent.EXTRA_EMAIL, shareEmail);
		sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, shareSubject);
		sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);
		startActivity(Intent.createChooser(sharingIntent, "GuideMe! Report Bug via"));
	}

	public void AboutGuideMe(View view) {
		String aboutMessage = "'GuideMe!' is an easy to use android application helpful " +
				"for first time visitors or tourists who are unaware of places of " +
				"interest around them.\n\n" +
				"Thank you for using GuideMe!\n\n" +
				"Email: guideme.app@gmail.com\n\n" +
				"Developer: Chandeep Singh";

		AlertDialog.Builder builder = new AlertDialog.Builder(this);
		builder.setMessage(aboutMessage)
		.setCancelable(false)
		.setPositiveButton("OK", new DialogInterface.OnClickListener() {
			public void onClick(DialogInterface dialog, int id) {
				//do things
			}
		});
		AlertDialog alert = builder.create();
		alert.show();
	}
}
